import request from '@/utils/request'

export function GoodsAPI(params) {
  return request({
    url: '/basicdata/goods/',
    method: 'get',
    params
  })
}

export function GoodsDetailAPI(id) {
  return request({
    url: `/basicdata/goods/${id}/`,
    method: 'get'
  })
}

export function GoodsCreateAPI(data) {
  return request({
    url: '/basicdata/goods/',
    method: 'post',
    data
  })
}

export function GoodsUpdateAPI(data) {
  return request({
    url: `/basicdata/goods/${data.id}/`,
    method: 'put',
    data
  })
}

export function GoodsPatchAPI(data) {
  return request({
    url: `/basicdata/goods/${data.id}/`,
    method: 'patch',
    data
  })
}

export function GoodsDeleteAPI(id) {
  return request({
    url: `/basicdata/goods/${id}/`,
    method: 'delete'
  })
}
